/**
 * JAVACC DEMO 1.0
 * @copy right dwusoft company All rights reserved. 
 * @Package com.dwusoft.passport.common  
 */
package com.apache.passport.common;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;

/**
 * description:  通讯操作
 * @author Hou Dayu 创建时间：2015-1-5  
 * @Copyright(c)2014:
 */
public class SsoPassportReport {

	/**
	 * description:  将数据流转换成成string
	 * @param is
	 * @return  
	 * @author Hou Dayu 
	 * @update 2014-12-31
	 */
	private static String InputStreamToString(InputStream is) {
		BufferedReader reader = null;
		StringBuffer responseText = null;
		String readerText = null;
		try {
			reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
			responseText = new StringBuffer();
			readerText = reader.readLine();
			while (readerText != null) {
				responseText.append(readerText);
				responseText.append(System.getProperty("line.separator"));
				readerText = reader.readLine();
			}
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return responseText.toString();
	}
}
